home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbgetoff.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.5 KB  |  70 lines

  1. .Na "dbgetoff" 
  2. .Aa
  3. .Fu
  4. Check for the existence of \*N constructs in the command buffer.
  5. .Ih "\*N constructs, checking for"
  6. .Ih "DBOFFSET option"
  7. .Ih "offsets to \*N constructs"
  8. .Sy
  9. .Sf "int dbgetoff(dbproc, offtype, startfrom)"
  10. .Sp DBPROCESS *dbproc
  11. .Sp DBUSMALLINT\   offtype
  12. .Sp int startfrom
  13. .Co
  14. .Bl
  15. If the DBOFFSET option has been set (see the
  16. .I options
  17. manual page), this routine can check for the location of certain
  18. \*N constructs in the command buffer.  As a simple example, assume
  19. the program doesn't know the contents of the command buffer 
  20. but needs to know where the SQL keyword SELECT appears:
  21. .ta +4n +4n +4n +4n +4n +4n
  22. .SD
  23. .so dbgetoff.ex
  24. .ED
  25. In this example, select_offset[0] = 0 and select_offset[1] = 15.
  26. .Bz
  27. .Pa
  28. .Pi dbproc
  29. A pointer to the DBPROCESS structure that provides the connection
  30. for a particular front-end/\*S process.  It contains all the
  31. information that \*L uses to manage communications and data between the
  32. front end and \*S.
  33. .Pi offtype
  34. The type of offset you want to find.  The types are defined in the
  35. .Ih "offsets, types of"
  36. header file \f2sybdb.h\f1 and are:
  37. .sp 0.5v
  38. .nf
  39. .in +5n
  40. .ne 9
  41. OFF_SELECT
  42. OFF_FROM
  43. OFF_ORDER
  44. OFF_COMPUTE
  45. OFF_TABLE
  46. OFF_PROCEDURE
  47. OFF_STATEMENT
  48. OFF_PARAM
  49. OFF_EXEC
  50. .in -5n
  51. .fi
  52. .sp 0.5v
  53. See the \f2options\f1 manual page for details.
  54. .sp
  55. .Pi startfrom
  56. The point in the buffer to start looking.  The command buffer
  57. begins at 0.
  58. .in -.375i
  59. .Re
  60. .br
  61. The character offset into the command buffer for the specified offset.
  62. If the offset is not found, -1 is returned.
  63. .Sa
  64. dbcmd,
  65. dbgetchar,
  66. dbsetopt,
  67. dbstrcpy,
  68. dbstrlen,
  69. options
  70.